package com.snda.game.legend.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.snda.game.legend.dao.LegendDao;
import com.snda.game.legend.entiy.Legend;

@Service
@Transactional
public class LegendService implements BaseService<Legend> {
	@Resource
	private LegendDao legendDao;

	@Override
	public Legend find(int id) {
		return legendDao.query(Legend.class, id);
	}

	@Override
	public Legend modify(Legend t) {
		return legendDao.update(t);
	}

	@Override
	public void delete(Legend t) {
		legendDao.delete(t);

	}

	@Override
	public Legend add(Legend t) {
		return legendDao.insert(t);
	}

	@Override
	public List<Legend> find(String queryString) {
		return legendDao.query(queryString);
	}
	
	public List<Legend> queryCurrentServers(){
		return legendDao.queryCurrentServers();
	}

    public List<Legend> queryNextServers() {
        return legendDao.queryNextServers();
	}

    public List<Legend> queryBeforeServers() {
        return legendDao.queryBeforeServers();
    }

    public List<Legend> queryPerviousServers() {
        return legendDao.queryPerviousServers();
    }
    public void nextRound(){
    	legendDao.nextRound();
    }

    public void expired() {
        legendDao.expired();

    }
}
